package ch.zbw.timeline.service;

import java.util.List;

import ch.zbw.timeline.domain.Allocation;
import ch.zbw.timeline.domain.DailyPresence;
import ch.zbw.timeline.domain.Entry;
import ch.zbw.timeline.domain.OverTimePool;

/**
 * Interface that handles the entry. The entry are generated and saved to the
 * database The entry can be read from the database
 * 
 * @author Andreas Kaderli
 * @version 12.12.2011
 * 
 */
public interface EntryService {

	/**
	 * These method create a new entry and save it to to database
	 * 
	 * @param dailyPresence
	 *            the date of the entry
	 * @param duration
	 *            the duration of the entry
	 * @param allocation
	 *            the allocation of the entry
	 * @param comment
	 *            the comment of the entry
	 * @param overTimePool
	 *            the overTimePool of the entry if it needed
	 * @return return the new entry
	 */
	public Entry createEntry(DailyPresence dailyPresence, double duration,
			Allocation allocation, String comment, OverTimePool overTimePool);

	/**
	 * These method save the entry to the database
	 * 
	 * @param entry
	 *            the entry to save
	 * @return return the entry who is save
	 */
	public Entry saveEntry(Entry entry);

	/**
	 * These method return a list of entry by dailyPresence
	 * 
	 * @param dailyPresence
	 *            the dailyPresence of the entry
	 * @return returns a entry whit all entries
	 */
	public List<Entry> getAllEntries(DailyPresence dailyPresence);

	/**
	 * Delete an entry.
	 * 
	 * @param entry
	 *            to delete
	 */
	public void delete(Entry entry);

}